﻿using System;
using System.Data;
using System.Collections.Generic;

namespace SemiCASE.DataAccess
{
    public interface IData
    {
        #region Properties
        bool IsTransactional { get; }
        string ConnectionName { get; }
       
        #endregion


        #region methods

        void BeginTransaction();

        void CommitTransaction();

        void RollbackTransaction();

        int ExecuteStatement(string ssql);

        int ExecuteStatement(string ssql, CommandType commandType);

        void ExecuteStatement(string storedprocedureName, DataSet ds);

        Dictionary<string, object> ExecuteStatementUDI(string storedProcedureOrFunctionName);

        object ExecuteScalar(string ssql, CommandType commandType);

        void GetRecords(DataSet ds, string ssql);

        void GetRecords(DataSet ds, string ssql, string stable, CommandType commandType);

        void GetRecords(DataSet ds, string ssql, string stable);

        void GetRecords(DataTable dt, string ssql);

        void GetRecords(DataSet ds, string ssql, CommandType commandType);

        DataSet GetRecords(string ssql, CommandType commandType);

        void GetRecords(DataTable dt, string ssql, CommandType commandType);

        void GetRecords(DataTable dt, string ssql, bool withSchema);

        void GetRecords(DataTable dt, string ssql, CommandType commandType, bool withSchema);

        void Update(DataSet ds, string ssql, string sTable);

        void Update(DataSet ds);

        void Update(DataTable dt);      

        void AddSqlParameter(string parameterName, SqlDbType dbType, ParameterDirection direction, int parameterSize);

        void AddSqlParameter(string parameterName, object parameterValue, SqlDbType dbType);

        void AddSqlParameter(string parameterName, object parameterValue, SqlDbType dbType, ParameterDirection direction);

        void AddSqlParameter(string parameterName, object parameterValue, SqlDbType dbType, ParameterDirection direction, int parameterSize);

        #endregion
    }
}
